package com.cskaoyan.mapper;

import com.cskaoyan.bean.Admin;
import com.cskaoyan.bean.AdminExample;

import java.util.List;


import com.cskaoyan.bean.AdminInfo;
import com.cskaoyan.bean.LogExample;
import com.cskaoyan.bean.vo.AdminInfoSonVo;
import com.cskaoyan.bean.vo.AdminLogBo;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface AdminMapper {
    long countByExample(AdminExample example);

    int deleteByExample(AdminExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(Admin record);

    int insertSelective(Admin record);

    List<Admin> selectByExample(AdminExample example);

    Admin selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") Admin record, @Param("example") AdminExample example);

    int updateByExample(@Param("record") Admin record, @Param("example") AdminExample example);

    int updateByPrimaryKeySelective(Admin record);

    int updateByPrimaryKey(Admin record);


    List<AdminLogBo> queryAdminLogListByPage(LogExample logExample);

    List<String> selectPasswordByUsername(@Param("username") String username);

    Admin selectRoleIds(@Param("username") String username);

    List<String> selectPermissionsByRoleId(@Param("roleId") Integer roleId);

    AdminInfoSonVo selectNameAndAvatar(@Param("username") String username);

    List<String> selectRoles(@Param("roleIds") Integer[] roleIds);

    List<String> selectRolesPermissionsByPermission(@Param("name") String name);

}